<#assign base=request.contextPath>
<!DOCTYPE html> 
<html>
	<head>
		<title></title>
		<meta charset="utf-8">
		<#include "common/reference.ftl" />
		<script type="text/javascript">
		$(function(){
			$('#btnSubmit').click(function(){
				var phoneNo = $('#phoneNo').val();
				var balance = $('#balance').val();
				if(phoneNo == null || phoneNo.length < 11){
					layer.msg('请输入正确的手机号');
					return;
				}
				if(balance <= 0 ){
					layer.msg('请输入充值金额');
					return;
				}
				if(balance >= 2000){
					layer.msg('输入充值金额太大');
					return;
				}
				
		    	layer.confirm('请确定用户和金额正确吗？',function(){
		    		var balance = $('#balance').val();
			    	$.ajax({
						url:'${base}/user/submitRecharge',
						type:'POST',
						data:{phoneNo:${phoneNo},balance:balance},
						dataType:'json',
						success:function(rst){
							layer.msg(rst.message);
						}
					});
				});
			});
		})
		</script>
	</head>
	<body>
		<div class="row">
			<#include "common/breadcrumb.ftl">
			<div class="form-horizontal">
				<div class="col-xs-12">
					<div class="widget-box">
						<div class="widget-body">
							<div class="alert alert-warning">
								<strong>提示!</strong>
								手机号不能为空
							</div>
							<div class="form-group">
								<label class="col-sm-3 control-label no-padding-right">
									手机号
								</label>
								<div class="col-sm-5">
									<input type="text" id="phoneNo" value="${phoneNo}" class="form-control" maxlength="20" placeholder="请输入用户手机号">
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-3 control-label no-padding-right">
									充值金额
								</label>
								<div class="col-sm-5">
									<input type="text" id="balance" value="" class="form-control" maxlength="30" placeholder="请输入充值金额,单次最多不能超过2000元">
								</div>
							</div>
							<div class="clearfix form-actions">
								<div class="col-md-offset-3 col-md-9">
									<button id="btnSubmit" class="btn btn-info" type="button">
										<i class="fa fa-check bigger-110"></i>
										充 值
									</button>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</body>
</html>